package com.atguigu.system.controller;


import com.atguigu.common.result.Result;
import com.atguigu.system.model.entity.ProductInfoFlow;
import com.atguigu.system.service.ProductInfoFlowService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2025-03-01
 */
@RestController
@RequestMapping("/system/product-info-flow")
public class ProductInfoFlowController {

    @Autowired
    private ProductInfoFlowService flowService;


    @GetMapping("/page")
    public Result<?> pageSkus(@RequestParam(defaultValue = "1") long current,
                              @RequestParam(defaultValue = "10") long size,
                              @RequestParam(required = false) String name,
                              @RequestParam(required = false) String type) {
        Page<ProductInfoFlow> page = new Page<>(current, size);
        Page<ProductInfoFlow> spuPage = flowService.pageSpusByName(page,name,type);
        return Result.ok(spuPage);
    }
}

